<!-- extends表明此页面继承自 base.html 文件 -->
{% extends "base.html" %}
{% load staticfiles %}

<!-- 写入 base.html 中定义的 title -->
{% block title %}
首页
{% endblock title %}

<!-- 写入 base.html 中定义的 content -->
{% block content %}
<div class="container">
<a href="{% url 'kucun:kucun_list' %}" class="btn btn-primary btn-lg active" role="button">库存主页</a>
<a href="{% url 'kucun:kucun_add' %}" class="btn btn-primary btn-lg active" role="button">物料添加</a>
<a href="{% url 'kucun:zhizuo_add' %}" class="btn btn-primary btn-lg active" role="button">制作添加</a>
<a href="{% url 'kucun:zhizuo_note' %}" class="btn btn-primary btn-lg active" role="button">制作记录</a>
</div>

<!-- 定义放置文章标题的div容器 -->
<div class="container">
    <div class="row mt-2" style="color: red">
        <h3>成品总数：{{ kucun.chengpin_num }}</h3>
    </div>
    <div class="row mt-2">
        <h3>剩余物料：</h3>
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>物品</th>
                    <th>数量</th>
                </tr>
            </thead>
            <tbody>
                {% comment %} <tr>
                    <td>成品：</td>
                    <td>{{ kucun.chengpin_num }}</td>
                </tr> {% endcomment %}
                <tr>
                    <td>空板：</td>
                    <td>{{ kucun.ban_num }}</td>
                </tr>
                <tr>
                    <td>绿灯珠：</td>
                    <td>{{ kucun.green_num }}</td>
                </tr>
                <tr>
                    <td>红灯珠：</td>
                    <td>{{ kucun.red_num }}</td>
                </tr>
                <tr>
                    <td>黄灯珠：</td>
                    <td>{{ kucun.yellow_num }}</td>
                </tr>
                <tr>
                    <td>电阻：</td>
                    <td>{{ kucun.dianzu_num }}</td>
                </tr>
                <tr>
                    <td>二极管：</td>
                    <td>{{ kucun.erjiguan_num }}</td>
                </tr>
            </tbody>
        </table>
    </div>

    <div class="row mt-2">

        <h3>出库记录：</h3>
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>时间</th>
                    <th>领取人</th>
                    <th>领取数量</th>
                </tr>
            </thead>
            <tbody>
                {% for lq in lingqu %}
                <tr>
                    <td>{{ lq.chuku_date }}</td>
                    <td>{{ lq.lingqu_name }}</td>
                    <td>{{ lq.lingqu_num }}</td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
    <div class="row mt-2">

        <h3>制作数量:</h3>
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>制作人</th>
                    <th>焊</th>
                    <th>插</th>
                    <th>剪</th>
                </tr>
            </thead>
            <tbody>
                {% for zz in zhizuo %}
                <tr>
                    <td>{{ zz.zhizuo_name }}</td>
                    <td>{{ zz.han_total_num }}</td>
                    <td>{{ zz.cha_num }}</td>
                    <td>{{ zz.jian_num }}</td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endblock content %}